RFM2g_VXW_6.9 - GE Intelligent Platforms RFM2g Driver documentation
This document will guide you through the installation of the SW/RFM2G-DRV-VXW Device Driver for the 2 GigaBaud Reflective Memory Interfaces for the VxWorks 6.9 operating systems. The RFM2g driver will be built into the VxWorks kernel image for your target processor.
Note: Installation for older VxWorks operating systems, may be quite different from VxWorks 6.9 so please refer to the installation procedure that accompanies the older driver(s) for details on how to install the older VxWorks code.
All available drivers for the Reflective Memory products can be downloaded from the product web site. Whenever possible, please use the appropriate driver code.
In order to allow user space application, RTP, to directly access the reflective memory region, RFM2G driver uses VxWorks device memory (DEVMEM) object. OS component "INCLUDE_DEVMEM" will be included with "DRV_RFM2G_PCI". By default, DEVMEM library initialization code will create a DEVMEM root level file object, "/devm". Other DEVMEM object created by device driver modules will be placed below "/devm". RFM2g driver creates one instance of "/devm/PCIRFM2G_x" device memory module for each hardware instance it found. This can be verified by the following steps at the OS prompt. (two RFM cards example).
-> devs drv name 0 /null 1 /tyCo/0 1 /tyCo/1 2 /devm 9 host: 10 /PCIRFM2G_0 /* the is the PCI RFM2G device */ 11 /VMERFM2G_0 /* the is the VME RFM2G device */ 12 /vio value = 25 = 0x19 -> ls "/devm" /devm/PCIRFM2G_0 /* the is the RFM2G device memory object */ /devm/VMERFM2G_0 /* the is the RFM2G device memory object */ value = 0 = 0x0 ->Note: device "/devm" is a pseudo device. User cannot "cd" to this device.
To access the memory from user space, user need to follow the call sequences below:
/* Open the Reflective Memory device */ result = RFM2gOpen( device, &handle ); if( result != RFM2G_SUCCESS ) { return(-1); } /* acquire mapped memory to pBuffer */ result = RFM2gUserMemory(handle, (volatile void **)(&pBuffer), 0, 0x100000); /* map 1MB from offset 0 */ if( result != RFM2G_SUCCESS ) { RFM2gClose( &handle ); return(-1); } /* start accessing memory directly from pBuffer */ ... ... ... /* done accessing memory directly from pBuffer */ /* release mapped memory from pBuffer */ result = RFM2gUnMapUserMemory(handle, (volatile void **)(&pBuffer), 1); if( result != RFM2G_SUCCESS ) { /* Close the Reflective Memory device */ RFM2gClose( &handle ); return(-1); } /* Close the Reflective Memory device */ RFM2gClose( &handle );please refer to sample/rfm2g_map.c for coding example.
For hardware installation information, refer to the "Hardware Reference" manual.
- 1. Boot the VxWorks development system
- 2. Prepare Source File
Insert the RFM2G driver distribution media into the CD-ROM device. Locate the 162-RFM2G-DRV-VXW-VXBUS-Rxxx.zip file
- 3. Extract RFM2g driver zip file
Extract the RFM2g driver zipfile. The package will contain the following directories:
directory Note RFM2g PCI RFM2g driver files and Common kernel library RFM2g/include PCI RFM2g driver header files (for kernel and RTP) RFM2g/samples PCI RFM2g driver sample files (for kernel and RTP) RFM2g/rtp Common RFM2g RTP library RFM2g/doc document folder - 4. Copy the RFM2g directory
Copy RFM2g folder from the zip file and its contents to following folder
%WIND_BASE%\target\config\RFM2g
Note: It is every important that you name the directory exactly as shown above and create it in exactly the location recommended. This is because the ".cdf" files (which we will get to shortly) expect the source code files to be located in the exact directories specified above.
- 5. Copy RFM2g .cdf files
The following ".cdf" files in the driver code (just moved to "RFM2g" directory) are used to inform the VxWorks development environment where the various components of the driver are located. This is necessary for the development environment to find, compile, and link the driver into the kernel image.
%WIND_BASE%\target\config\RFM2g\40gefRfm2g.cdf
%WIND_BASE%\target\config\RFM2g\40gefRfm2gPciDrv.cdf
%WIND_BASE%\target\config\RFM2g\40gefRfm2gSamples.cdf
For the VxWorks 6.9 development environments, copy all three cdf files to your BSP folder:
For example, if your target BSP is itl_sandybridge_64
Copy these three CDF files to your BSP directory.
%WIND_BASE%\target\config\itl_sandybridge_64\
The project facility can now be used to include RFM2g components in your vip (vxWorks Image Project) project that is created based on your BSP, eg. itl_sandybridge_64.
- 6. Copy default component file for your BSP (optional)
If user want to automatically include the RFM2g component, user can copy %WIND_BASE%\target\config\RFM2g\include\geConfigRfm2g.h to the BSP folder then add #include "geConfigRfm2g.h" and the end of BSP config.h file.
- 1. Start VxWorks Workbench 3.3
- 2. Create VIP Project
a. From [Workbench Window], in menu bar,
1) select [File] -> [New] -> [Project...]
b. From [New Project]:[Select a wizards] dialog box,
1) select [VxWorks 6.x]->[VxWorks Image Project]
2) select [Next>]
c. From [New VxWorks Image Project]:[Project] dialog box,
1) in [Project Name:], enter "rfm2g_test_64"
2) select [Next>]
d. From [New VxWorks Image Project]:[Project Setup] dialog box,
1) in [Setup the Project]->[BSP:], select "itl_sandybridge_64"
2) verify [Address mode:] is "64-bit kernel"
3) [Tool chain:] is "gnu"
4) select [Next>]
e. From [New VxWorks Image Project]:[Options] dialog box,
1) check [SMP support in kernel]
2) select [Next>]
f. From [New VxWorks Image Project]:[Configuration Profile] dialog box,
1) select [Next>]
g. From [New VxWorks Image Project]:[Indexer] dialog box,
1) select [Finish]
- 3. Include RFM2g components
a. From [Project Explorer],
1) double click [rfm2g_test_64 (Wind River VxWorks 6.9 Image Project)] to expand the project content.
2) double click [Kernel Configuration]
b. From [rfm2g_test_64] Components window,
1) expand [hardware] component folder.
2) expand [GE RFM2g] component folder.
3) include [GE RFM2G IO subsystem driver (IOCTL suport for RTP)], DRV_RMF2G_IOS
4) include [GE RFM2G Kernel API Library], GEF_RMF2G_KERNEL_LIB
5) include [GE RFM2G PCI VxBus driver], DRV_RMF2G_PCI
c. From [rfm2g_test_64] Components window,
1) expand [hardware] component folder.
2) expand [GE RFM2g] component folder.
3) include [GE RFM2G IO subsystem driver (IOCTL suport for RTP)], DRV_RMF2G_IOS
4) include [GE RFM2G Kernel API Library], GEF_RMF2G_KERNEL_LIB
5) include [GE RFM2G PCI VxBus driver], DRV_RMF2G_PCI
6) expand [GE RFM2g Sample Programs] component folder.
7) include [GE RFM2G MAP Program], GEF_RMF2G_MAP
8) include [GE RFM2G RECEIVER Program], GEF_RMF2G_RECEIVER
9) include [GE RFM2G SENDER Program], GEF_RMF2G_SENDER
10) include [GE RFM2G Utility Program], GEF_RMF2G_UTIL
- 4. Build VxWorks image
a. From [Project Explorer],
1) right click [rfm2g_test_64 (Wind River VxWorks 6.9 Image Project)]
2) from quick menu, select [Rebuild Project]
- 5. Run RFM2g driver in VxWorks image
a. copy vxWorks file to FTP server folder where vxWorks image can access.
b. boot to vxWorks OS prompt
c. Following show rfm2g_util execution example from vxWorks OS prompt,
-> rfm2g_util PCI/VME RFM2g Commandline Diagnostic Utility Available devices: x : PCI /PCIRFM2G_x : PCI /VMERFM2G_x : VME (x = device instance) Please enter device number: 0 UTIL0 > config /* retrieve current configuration */ Driver Part Number "SFT-RFM2G-VXW" Driver Version "R09.20" Device Name "/PCIRFM2G_0" Board Instance 0 Board ID 0x65 Node ID 0x01 Installed Memory 128 MB (0x08000000) Memory Offset: 0x00000000 Board Revision 0x8C Build Id 0x0001 PLX Revision 0xC0 Config.Lcsr1 0x0058008a RFM2g Configuration: Fast Mode RFM2g PCI Configuration: bus number 0x02 dev number 0x04 func number 0x00 device ID 0x5565 RFM2g Device Access Info: orReg HwBase 0xa1000000 orReg Base 0xa1000000 orReg WinSize 0x00000200 orReg Size 0x00000200 csReg HwBase 0xa1000200 csReg Base 0xa1000200 csReg WinSize 0x00000200 csReg Size 0x00000200 rfMem HwBase 0xa1200000 rfMem Base 0xa1200000 rfMem WinSize 0x00200000 rfMem Size 0x00200000 UTIL0 > quit Exit? (y/n) : y value = 0 = 0x0 ->d. Following show rfm2g_util execution example from vxWorks OS prompt for VME device,
-> rfm2g_util PCI/VME RFM2g Commandline Diagnostic Utility Available devices: x : PCI /PCIRFM2G_x : PCI /VMERFM2G_x : VME (x = device instance) Please enter device number: /VMERFM2G_0 UTIL0 > config Driver Part Number "SFT-RFM2G-VXW" Driver Version "R09.10" Device Name "/VMERFM2G_0" Board Instance 0 Board ID 0x65 Node ID 0x03 Installed Memory 128 MB (0x08000000) Memory Offset: 0x00000000 Board Revision 0x06 Build Id 0x0000 PLX Revision 0x00 Config.Lcsr1 0x00100084 RFM2g Configuration: Fast Mode RFM2g VME Configuration: reg AM code 0x0d mem AM code 0x0d RFM2g Device Access Info: orReg HwBase 0x68000000 orReg Base 0x68000000 orReg WinSize 0x00001000 orReg Size 0x00001000 csReg HwBase 0x68001200 csReg Base 0x68001200 csReg WinSize 0x00000040 csReg Size 0x00000040 rfMem HwBase 0x60000000 rfMem Base 0x60000000 rfMem WinSize 0x08000000 rfMem Size 0x08000000 UTIL0 >
- 1. Start VxWorks Workbench 3.3
- 2. Create rfm2g_util_64 RTP project
a. From [Workbench Window], in menu bar,
1) select [File] -> [New] -> [Project...]
b. From [New Project]:[Select a wizards] dialog box,
1) select [VxWorks 6.x]->[VxWorks Real Time Process Project]
2) select [Next>]
c. From [New VxWorks Real Time Process Project]:[Project] dialog box,
1) in [Project Name], enter "rfm2g_util_64"
2) select [Next>]
d. From [New VxWorks Real Time Process Project]:[Build Defaults] dialog box,
1) select [Next>]
e. From [New VxWorks Real Time Process Project]:[Build Support] dialog box,
1) select [Next>]
f. From [New VxWorks Real Time Process Project]:[Build Specs] dialog box,
1) [Deselect All]
2) check [NEHALEMgnu_LP64_RTP]
3) select [Next>]
g. From [New VxWorks Real Time Process Project]:[Build Target] dialog box,
1) verify [Build target name: ] is "rfm2g_util_64"
2) verify [Binary output name:] is "rfm2g_util_64"
3) select [Next>]
h. From [New VxWorks Real Time Process Project]:[Indexer] dialog box,
1) select [Finish]
- 3. Include RFM2g source files
a. From [Project Explorer],
1) right click [rfm2g_util_64 (Wind River VxWorks 6.9 Real Time Process Project)]
2) from quick menu, select [Import...]
b. From [Import]:[Select] dialog box,
1) select and highlight [General]:[File System]
2) [Next>]
c. From [Import]:[File system] dialog box,
1) [Browse...]
e. From [Import from directory] dialog box,
1) browse directory to %WIND_BASE%\target\config\RFM2g
2) select [OK]
f. From [Import]:[File system] dialog box,
1) check
rtp\close.c
rtp\config.c
rtp\vent.c
rtp\open.c
rtp\rfm2g_errno.c
rtp\transfer.c
rtp\util.c
samples\rfm2g_util.c
2) select [Finish]
g. Following sample files are separate utilities that can be
compiled and run exactly as described VXE in the above steps.
However, all of these are stand-alone files and do not need other
modules included in the compile like "rfm2g_util.c" module does:
samples\rfm2g_map.c
samples\rfm2g_receiver.c
samples\rfm2g_sender.c
- 4. Add include path and define
a. From [Project Explorer],
1) right click [rfm2g_util_64 (Wind River VxWorks 6.9 Real Time Process Project)]
2) from quick menu, select [Properties]
b. From [Properties for rfm2g_util_64] dialog box,
1) select and hight light [Build Properties] on the left window pan
c. From [Properties for rfm2g_util_64] dialog box,
1) select and hight light [Build Properties] on the left window pan
2) select [Build Properties][Paths] tab on the right window pan
3) click [Add...] in Include paths:
e. From [Add include serch path to selected build spec] [Value:] edit box,
1) type "-I$(WIND_BASE)/target/config/RFM2g", or
browse to select "$(WIND_BASE)/target/config/RFM2g" folder
2) type "-I$(WIND_BASE)/target/config/RFM2g/include", or
browse to select "$(WIND_BASE)/target/config/RFM2g/include" folder
3) type "-I$(WIND_BASE)/target/config/RFM2g/samples", or
browse to select "$(WIND_BASE)/target/config/RFM2g/samples" folder
4) select [OK]
e. From [Properties for rfm2g_util_64] dialog box,
1) select and hight light [Build Properties] on the left window pan
2) select [Build Properties][Defines] tab on the right window pan
3) click [Add...] in Include paths:
f. From [Add define to selected build spec] dialog box,
1) check [Add Define (-D)] radio button.
2) type "-DRFM2G_VXWORKS"
3) select [OK]
g. From [Properties for rfm2g_util_64] dialog box,
1) select [OK]
h. (Optional) From [C/C++ Index configuration changed] dialog box,
1) select [Yes]
- 5. Build RTP executable files, VXE
a. From [Project Explorer],
1) right click [rfm2g_util_64 (Wind River VxWorks 6.9 Real Time Process Project)]
2) from quick menu, select [Rebuild Project]
- 6. Run RTP executable files, VXE
a. copy .vxe file to FTP server folder where vxWorks image can access.
b. boot to vxWorks OS prompt
c. Following show rfm2g_util.vxe execution from vxWorks OS prompt,
-> cmd /* enter command mode */ [<vxWorks *>]# rtp exec "rfm2g_util.vxe" Launching process 'rfm2g_util.vxe' ... Process 'rfm2g_util.vxe' (process Id = 0x25cc2a0) launched. PCI/VME RFM2g Commandline Diagnostic Utility Available devices: x : PCI /PCIRFM2G_x : PCI /VMERFM2G_x : VME (x = device instance) Please enter device number: 0 UTIL0 > config Driver Part Number "SFT-RFM2G-VXW" Driver Version "R09.20" Device Name "/PCIRFM2G_0" Board Instance 0 Board ID 0x65 Node ID 0x01 Installed Memory 128 MB (0x08000000) Memory Offset: 0x00000000 Board Revision 0x8C Build Id 0x0001 PLX Revision 0xC0 Config.Lcsr1 0x0058008a RFM2g Configuration: Fast Mode RFM2g PCI Configuration: bus number 0x02 dev number 0x04 func number 0x00 device ID 0x5565 RFM2g Device Access Info: orReg HwBase a1000000 orReg Base a1000000 orReg WinSize 0x00000200 orReg Size 0x00000200 csReg HwBase a1000200 csReg Base a1000200 csReg WinSize 0x00000200 csReg Size 0x00000200 rfMem HwBase a1200000 rfMem Base a1200000 rfMem WinSize 0x00200000 rfMem Size 0x00200000 UTIL0 > quit Exit? (y/n) : y [<vxWorks *>]# C /* exit command mode, return to C interpreter */ -> ->- 6. Build RTP executable files, VXE, from VxWorks Development Shell
a. start "VxWorks Development Shell"
b. cd to %WIND_BASE%\target\config\RFM2g\rtp
c. type buildall.
This will build rfm2g_util.vxe, rfm2g_sender.vxe, rfm2g_receiver.vxe and
rfm2g_map.vxe RTP executiables for following target processors.
1) NEHALEM 64-bit @ %WIND_BASE%\target\config\RFM2g\rtp\NEHALEMgnu_LP64_RTP
2) NEHALEM 32-bit @ %WIND_BASE%\target\config\RFM2g\rtp\NEHALEMgnu_RTP
3) PENTIUM4 32-bit @ %WIND_BASE%\target\config\RFM2g\rtp\PENTIUM4gnu_RTP
3) PPC 32-bit @ %WIND_BASE%\target\config\RFM2g\rtp\PPC32gnu_RTP
Delete the RFM2g folder and its corresponding .cdf files from the installed BSP directory.
VME-5565 can only be accessed from VMEbus through the on-board UNIVERSE_II VMEbus bridge slave windows. Slave window 0 is for accessing RFM2g register address space. Slave window 4 is for accessing RFM2g memory address space. Both hardware and software will need to be configured to access the RFM2g address spaces and have VME-5565 functioning correctly. Hardware configuration is done through manually configure VME-5565 on-board DIP switches. Software configuration includes update base BSP software, BSP VME bridge software and RFM2g driver settings.
All examples below use the following mapping relationship between host CPU and VME-5565.
From CPU to VME:
CPU address => PCI address => VME address 0x60000000 => 0x60000000 => 0x50000000 0x68000000 => 0x68000000 => 0x70000000 From VME to CPU:
CPU address <= PCI address <= VME address 0x00000000 <= 0x00000000 <= 0x00000000
- 1. RFM2g Register Address Space:
VMEbus address for RFM2g register space is controlled by on board switches,
S7, S3 and S4. The switch position definitions are listed below:
Switch Position Control S7 8 .. 1 A31 .. A24 S3 1 .. 8 A23 .. A16 S4 8 .. 7 A15 .. A14 S4 6 .. 4 reserved S4 3 VME address space on=A32, off=A24 S4 2 off = enable supervisory access S4 1 off = enable non-previllige access Withing the RFM2g register address space, the addresses are participated as below
Register Type Offset Universe 0x0000 to 0x0FFF PLX 0x1000 to 0x1FFF FPGA 0x1200 to 0x123F Byte Swap 0x2000 to 0x2FFF - 2. RFM2g Memory Address Space:
VMEbus address for RFM2g memory address space is controlled by S8.
The switch position definitions are listed below:
switch Position Control S8 8 .. 3 A31 .. A26 S8 2 off = enable supervisory access S8 1 off = enable non-previllige access Please refer to "VMICVME-5565 Hardware Reference" for further detail.
Following example shows configuration that RFM2g register address is set to
VME address 0x70000000.
Switch Position Setting Value S7 8 ON 0 (= A31) S7 7 OFF 1 (= A30) S7 6 OFF 1 (= A29) S7 5 OFF 1 (= A28) S7 4 ON 0 (= A27) S7 3 ON 0 (= A26) S7 2 ON 0 (= A25) S7 1 ON 0 (= A24) S3 1 .. 8 ON 0 (= A23 .. A16) S4 8 .. 7 ON 0 (= A15 .. A14) S4 6 .. 4 OFF S4 3 ON (A32 space) S4 2 OFF (= enable supervisory access) S4 1 OFF (= enable non-previllige access) Following example shows configuration that RFM2g memory address is set to
VME address 0x50000000.
Switch Position Setting Value S8 8 ON 0 (= A31) S8 7 OFF 1 (= A30) S8 6 ON 0 (= A29) S8 5 OFF 1 (= A28) S8 4 ON 0 (= A27) S8 3 ON 0 (= A26) S8 2 OFF (= enable supervisory access) S8 1 OFF (= enable non-previllige access) Note: RFM2g memory address space is always in VME A32 mode.
Software configuration includes settings to permit access from host CPU to RFM2g,
and to allow access from RFM2g to host CPU. The SBC host chipset needs to be
updated to permit CPU to access RFM2g VME address spaces, and also allow host
memory be accessed from other PCI masters in SBC.
In BSP VMEbus bridge software, VME master windows need to be set correctly
to translate PCI addresses to VME bus addresses, which in term can access RFM2g
address spaces. BSP VME bridge slave windows will need to be enabled for
DMA engine in VME-5565 to transfer data from RFM2g memory to host memory.
The BSP VME master windows settings need to have correct VME address modifier
and the window size must be at least as large as the RFM2g memory present. Also,
the VME master will need to map RFM2g register address space into correct PCI
address range.
- 1. From host CPU to RFM2g
a. Configure VME master windows in host VMEbus bridge
Check the master window settings in host VME bridge software and make sure the VME
addresses set by the VME-5565 DIP switch is included. If not, then VME master window
will need to be added/adjust to include the RFM2g VME address spaces.
Following example shows new VME master window settings are added into the file which
uses Windriver sysTempeXXXX driver. The new mapping will add two CPU(PCI) to VME address
translation windows as below:
Out Window CPU address => PCI address => VME address size 4 0x60000000 => 0x60000000 => 0x50000000 0x08000000 5 0x68000000 => 0x68000000 => 0x70000000 0x00040000 Modification to the source code is listed below:
#define VME_OUT4_START (0x60000000) #define VME_OUT4_SIZE (0x08000000) #define VME_OUT4_BUS (0x50000000) #define VME_OUT4_CFG_PARAMS \ TRUE, /* Window enabled */ \ 0, VME_OUT4_START, /* Local start addrs (upper = 0) */ \ 0, VME_OUT4_SIZE, /* Size (upper = 0) */ \ 0, VME_OUT4_BUS, /* VME bus addr (upper = 0) */ \ 0, /* 2eSST broadcast select */ \ 0, /* Unused */ \ TRUE, /* Read prefetch enable state */ \ VME_RD_PREFETCH_2_CACHE_LINES, \ VME_SST160, /* 2esst xfer rate */ \ VME_MBLT_OUT, /* transfer mode */ \ VME_D32, /* VME data bus width */ \ FALSE, /* nonsupervisor access */ \ FALSE, /* Not pgm but instead data access */ \ VME_MODE_A32 /* transfer mode */ #define VME_OUT5_START (0x68000000) #define VME_OUT5_SIZE (0x00040000) #define VME_OUT5_BUS (0x70000000) #define VME_OUT5_CFG_PARAMS \ TRUE, /* Window enabled */ \ 0, VME_OUT5_START, /* Local start addrs (upper = 0) */ \ 0, VME_OUT5_SIZE, /* Size (upper = 0) */ \ 0, VME_OUT5_BUS, /* VME bus addr (upper = 0) */ \ 0, /* 2eSST broadcast select */ \ 0, /* Unused */ \ FALSE, /* Read prefetch enable state */ \ VME_RD_PREFETCH_2_CACHE_LINES, \ VME_SST160, /* 2esst xfer rate */ \ VME_SCT_OUT, /* transfer mode */ \ VME_D32, /* VME data bus width */ \ FALSE, /* nonsupervisor access */ \ FALSE, /* Not pgm but instead data access */ \ VME_MODE_A32 /* transfer mode */After adding the new setting, the VME master window output from sysTempeWinShow( )
is shown as below:
-> sysTempeWinShow ... Outbound window 4: ENABLED, Size = 00000000_08000000 raw: 00000000 60000000 00000000 67ff0000 ffffffff f0000000 00000000 80000242 PCI Base: 00000000_60000000 VME Base: 00000000_50000000 PCI Limit: 00000000_67ffffff VME Limit: 00000000_57ffffff 2eSST Broadcast Select: 0x00000 Attributes: Memory Prefetch - enabled Prefetch size - 2 cache lines 2eSST Mode - 160 MB/s Transfer Mode - MBLT (Multiplexed Block Transfer) VME Data Bus Width - 32 bit VME AM code - nonSupervisor, nonProgram VME Address mode - A32 Outbound window 5: ENABLED, Size = 00000000_00040000 raw: 00000000 68000000 00000000 68030000 00000000 08000000 00000000 80040042 PCI Base: 00000000_68000000 VME Base: 00000000_70000000 PCI Limit: 00000000_6803ffff VME Limit: 00000000_7003ffff 2eSST Broadcast Select: 0x00000 Attributes: Memory Prefetch - disabled Prefetch size - 2 cache lines 2eSST Mode - 160 MB/s Transfer Mode - SCT (Single Cycle Transfer) VME Data Bus Width - 32 bit VME AM code - nonSupervisor, nonProgram VME Address mode - A32 ... ->b. Enable host CPU address to RFM2g
To enable host CPU be able to access RFM2g address range, an entry is added in
sysPhysMemDesc[] array in BSP sysLib.c file.
PHYS_MEM_DESC sysPhysMemDesc [] = { ... { /* Access to RFM VME A32 space, size 256MB */ (VIRT_ADDR) VME_OUT4_START, (PHYS_ADDR) VME_OUT4_START, 0x10000000, VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_GUARDED, VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT | VM_STATE_GUARDED }, ... };- 2. From RFM2g to host CPU
a. Configure VME slave windows in host VMEbus bridge
Check the slave window settings in host VME bridge software and make sure the host
memory can be addressed by devices on VMEbus. If not, then new VME slave window
will need to be added/adjust to allow access from VMEbus.
Following example shows a new VME slave window setting is added into the file which
uses Windriver sysTempeXXXX driver. The new mapping will add one VME to CPU address
translation as below:
In Window CPU address <= PCI address <= VME address size 1 0x00000000 <= 0x00000000 <= 0x00000000 0x20000000 Modification to the source code is listed below:
#define VME_IN1_CFG_PARAMS \ TRUE, /* State of Window */ \ 0, 0x00000000, /* Start Address on VME bus */ \ 0, 0x20000000, /* Window Size */ \ 0, (0x00000000), /* Starting Address on PCI bus */ \ VME_RD_THRESHOLD_EMPTY, /* Read Prefetch Threshold state */ \ VME_VFS_FIFO_64, /* Read FIFO prefetch size */ \ VME_SST160, /* 2eSST Transfer Rate */ \ (VME_BLT_IN | /* Transfer protocol */ \ VME_MBLT_IN | \ VME_2eVME_IN | \ VME_2eSST_IN | \ VME_2eSST_BCAST_IN ), \ VME_SPACE_A32, /* Address space */ \ TRUE, /* Respond to super access */ \ TRUE, /* Respond to nonSuper access */ \ TRUE, /* Respond to pgm access */ \ TRUE, /* Respond to data access */ \ 0 /* For future use */After adding the new setting, the VME slave window output from sysTempeWinShow( )
is shown as below:
-> sysTempeWinShow ... Inbound window 1: ENABLED, Size = 00000000_20000000 raw: 00000000 00000000 00000000 1ffffff0 00000000 00000000 80000faf VME Base: 00000000_00000000 PCI Base: 00000000_00000000 VME Limit: 00000000_1fffffff PCI Limit: 00000000_1fffffff Attributes: Read-ahead threshold - when FIFO competely empty Virtual FIFO size - 64 bytes 2eSST Mode - 160 MB/s Cycle response - 2eSSTB (Two Edge Source Synchronous Broadcast) 2eSST (Two Edge Source Synchronous nonBroadcast) 2eVME (Two Edge VMEbus) MBLT (Multiplexed Block Transfer) BLT (Block Transfer) Address space - A32 VME AM response - Supervisor, nonSupervisor, Program, Data ... ->b. Enable host memory access from RFM2g
This step is different depending on the BSP. Basically, the pci controller will
need to allow other PCI master (such as VMEbus bridge) to access the host memory.
- 1. Install driver module
Please follow the INSTALLATION section in the beginning of this document to
install the driver package.
- 2. Modify hwconf.c
Locate file hwconf.c in BSP folder and add RFM2g bus controller device entry in
hcfDeviceList[] array as below.
const struct hcfDevice hcfDeviceList[] = { ... { "gefRfm2gBus", 0, VXB_BUSID_PLB, 0, 0, NULL}, ... };- 3. Update interrupt related functions
a. BSP interrupt CONNECT/ENABLE/DISABLE functions will need to be assigned to
have RFM2g driver function correctly. Interrupt related setting is located at:
[hardware]
->[GE RFM2g]
->[GE RFM2G Bus controller]
->[BSP int connect function]
->[BSP int disable function]
->[BSP int enable function]
->[VME VirqX int enable function]
By default, the "gefRfm2gBus" controller driver will assign these functions as below,
Parameter Description default settings BSP_INT_CONNECT_FUNC BSP interrupt connect function intConnect BSP_INT_ENABLE_FUNC BSP interrupt enable function intEnable BSP_INT_DISABLE_FUNC BSP interrupt disable function intDisable BSP_VIRQ_ENABLE_FUNC BSP VIRQx interrupt enable function sysIntEnable - 4. Update bus address translation function
a. BSP bus address translation functions will need to be assigned to have RFM2g
driver function correctly. Bus address translation functions settings are
located at:
[hardware]
->[GE RFM2g]
->[GE RFM2G Bus controller]
->[BUS_TO_LOCAL_ADRS translations function]
->[LOCAL_TO_BUS_ADRS translations function]
By default the "gefRfm2gBus" controller driver will assign these functions as below,
Parameter Description default comment BUS_TO_LOCAL_ADRS BSP interrupt connect function sysBusToLocal mapping defined in BSP sysBusToLocal () LOCAL_TO_BUS_ADRS BSP interrupt connect function 0 no translation, which means 1_to_1 mapping - 5. Change RFM2g driver parameters
a. Update VME board count
By default the VME board count is 0. This parameter can be changed in kernel
configuration from workbench, and it is located at
[hardware]
->[GE RFM2g]
->[GE RFM2g VME VxBus driver]
->[Number of RFM2g VME board]
This parameter needs to match the number of VME-5565 installed in the system.
b. Change VME addressing parameters
Every VME-5565 will need to have the following parameter updated from the
kernel configuration in "Workbench". Following
Parameter Description comment RFM2G_BOARDx_REG_VME_ADDR RFM2g register VME address This need to match the DIP switch setting RFM2G_BOARDx_MEM_VME_ADDR RFM2g memory VME address This need to match the DIP switch setting RFM2G_BOARDx_REG_AM RFM2g register VME addr modifier This need to match the DIP switch setting, default value is VME_AM_EXT_SUP_DATA (0x0d) RFM2G_BOARDx_MEM_AM RFM2g memory VME addr modifier This need to match the DIP switch setting, default value is VME_AM_EXT_SUP_DATA (0x0d) RFM2G_BOARDx_VME_BUS_IRQ VIRQ assigned for this board valid value is between 1 ~ 7 RFM2G_BOARDx_INT_VEC int vector in BSP (offset to BSP sysIntTbl[ ]) this is the vector retrieved in IACK cycle after VIRQ is triggered Following example shows the setting for the first board
Parameter Value RFM2G_BOARD0_REG_VME_ADDR 0x70000000 RFM2G_BOARD0_MEM_VME_ADDR 0x50000000 RFM2G_BOARD0_REG_AM 0x0D RFM2G_BOARD0_MEM_AM 0x0D RFM2G_BOARD0_VME_BUS_IRQ 0x07 RFM2G_BOARD0_INT_VEC 0xC1 These parameters can be changed in kernel configuration from workbench, and
they are located at:
[hardware] ->[GE RFM2g] ->[GE RFM2g VME VxBus driver] ...Note: For second to forth boards, the parameters are xxx_BOARD1_xxx to xxx_BOARD3_xxx.
For board without VXB style PCI bus controller, this version of driver provides support to the PCIe/PMC RFM2g module by adding the module driver under the "gefRfm2gBus" bus controller driver.
- 1. Install driver module
Please follow the INSTALLATION section in the beginning of this document to
install the driver package.
- 2. Modify hwconf.c
Add RFM2g bus controller device entry in hwconf.c hcfDeviceList[] array
as below.
const struct hcfDevice hcfDeviceList[] = { ... { "gefRfm2gBus", 0, VXB_BUSID_PLB, 0, 0, NULL}, ... };- 3. Change PCI RFM2g driver parameters
a. Change board count
By default the PCI board count is 0. This parameter can be changed in kernel
configuration from workbench, and it is located at
[hardware] ->[GE RFM2g] ->[GE RFM2g PCI VxBus driver] ->[Number of RFM2g PCI board]This parameter needs to match the number of PMC-5565 installed in the system.
b. Change PCI/PMC 5565 bus ID
By default the PCI bus ID is 3, VXB_BUSID_PCI. This parameter needs to be changed
to 10, VXB_BUSID_MF, in kernel configuration from workbench, and it is located at
[hardware] ->[GE RFM2g] ->[GE RFM2g PCI VxBus driver] ->[PCI RFM2g BUS ID]- 4. Update interrupt related functions
a. BSP interrupt CONNECT/ENABLE/DISABLE functions will need to be assigned to
have RFM2g driver function correctly. Interrupt related setting is located at
[hardware]
->[GE RFM2g]
->[GE RFM2G Bus controller]
->[BSP int connect function]
->[BSP int disable function]
->[BSP int enable function]
->[VME VirqX int enable function]
By default the "gefRfm2gBus" controller driver will assign these functions as below,
Parameter Description default BSP_INT_CONNECT_FUNC BSP interrupt connect function intConnect BSP_INT_ENABLE_FUNC BSP interrupt connect function intEnable BSP_INT_DISABLE_FUNC BSP interrupt connect function intDisable
(Product document can be downloaded from , http://www.ge-ip.com/products/reflective-memory/c544 or, http://defense.ge-ip.com/products/reflective-memory/c166), VxWorks User's Guide: Getting Started, VxWorks BSP Developer's Guide, RFM2g Operator's Reference (rfm2g_common.pdf), VME5565 Hardware Reference , PMC-5565 Hardware Reference